test#2
Open
github-actions[bot] wants to merge 122 commits intomainfrom
Open
Conversation
Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Luca Muscariello <muscariello@ieee.org> Co-authored-by: Yaroslav <yarolegovich@gmail.com> Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com> Co-authored-by: agil.yolchuyev <agilyolchuyev@outlook.com> Co-authored-by: yolagil <agil@peotic.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Co-authored-by: Luca Muscariello <muscariello@ieee.org> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…the specification (a2aproject#511) Commit: a2aproject/A2A@0a9f629 This PR introduces support for the new `tasks/list` method, including: - Automatically generated type definitions from the specification. - Complete client-side and server-side implementations. Fixes a2aproject#515 🦕 --------- Co-authored-by: lkawka <lkawka@google.com> Co-authored-by: lkawka <luk.kawka@gmail.com> Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com> Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com> Co-authored-by: Tadaki Asechi <127199356+TadakiAsechi@users.noreply.github.com> Co-authored-by: tadaki <tadaki.asechi@gmail.com> Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Co-authored-by: TadakiAsechi <tadaki.asechi@icould.com> Co-authored-by: TadakiAsechi <tadaki.asechi@iclould.com>
## Summary This PR migrates the a2a-python SDK from Pydantic-based types to protobuf-generated types, completing the upgrade to A2A v1.0. Fixes a2aproject#559 ## Breaking Changes - Replace Pydantic-based type system with protobuf types from `a2a_pb2` - Update `Part` usage from `Part(root=TextPart(text=...))` to `Part(text=...)` - Update `Role` enum from `Role.user`/`Role.agent` to `Role.ROLE_USER`/`Role.ROLE_AGENT` - Update `TaskState` enum to use `TASK_STATE_*` prefix ## Changes - Update all source files to use proto types directly from `a2a_pb2` - Replace `model_dump()` with `MessageToDict()` for JSON serialization - Replace `model_copy(deep=True)` with `CopyFrom()` for proto cloning - Add new types module with proto imports and SDK-specific extras - Add `proto_utils` module with identity conversion utilities - Fix REST handler resource name formats for push notification configs - Fix gRPC handler to use `SubscribeToTask` instead of `TaskSubscription` - Fix database task store to handle proto objects from ORM - Update all test files for proto patterns and assertions - Fix spelling check failures by updating allow list - Fix inclusive language check failures: - Replace `master` with `main` in documentation - Rename `Dummy` classes to `Mock` in tests ## Testing - **601 tests passing** - 23 tests skipped (expected - require DB connections or cryptography deps) ## Related Builds on top of PR a2aproject#556 Release-As: 1.0.0 --------- Signed-off-by: Luca Muscariello <muscariello@ieee.org> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com> Co-authored-by: Lukasz Kawka <luk.kawka@gmail.com> Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com> Co-authored-by: Didier Durand <2927957+didier-durand@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com> Co-authored-by: Will Chen <36873565+chenweiyang0204@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# Description Do not use `NULLS LAST` which is not available in MySQL, coalesce nulls to empty strings which will appear last in descending ordering (there are tests for this behavior already, however CI wasn't enabled for this branch). Currently `NULLS LAST` fails MySQL tests: ``` (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULLS LAST, tasks.id DESC \n LIMIT 51' at line 3") ``` ([actions run](https://github.com/a2aproject/a2a-python/actions/runs/21520017047/job/62008309612?pr=651)) Enable tests run against `1.0-dev` to prevent it in the future. Re a2aproject#511 Fixes a2aproject#652 --- Mark as "refactor" for release please as it's a fix for a non-released feature, hence shouldn't get into a changelog. BEGIN_COMMIT_OVERRIDE refactor: use MySQL compatible syntax in list tasks END_COMMIT_OVERRIDE
# Conflicts: # CHANGELOG.md # tests/client/transports/test_rest_client.py # tests/utils/test_proto_utils.py
# Description Merge `main` into `1.0-dev` through an intermediate branch to resolve conflicts. Opening a PR from `main` to `1.0-dev` required pushing to `main` to resolve conflicts. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com> Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com> Co-authored-by: Tadaki Asechi <127199356+TadakiAsechi@users.noreply.github.com> Co-authored-by: tadaki <tadaki.asechi@gmail.com> Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Co-authored-by: TadakiAsechi <tadaki.asechi@icould.com> Co-authored-by: TadakiAsechi <tadaki.asechi@iclould.com> Co-authored-by: ShishirRmc <113575088+ShishirRmc@users.noreply.github.com> Co-authored-by: Lukasz Kawka <luk.kawka@gmail.com> Co-authored-by: Didier Durand <2927957+didier-durand@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Will Chen <36873565+chenweiyang0204@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Vinay Ramesh <vinay.r.ramesh@gmail.com>
# Description Run linter on `1.0-dev`.
This reverts commit 40613ed. Should be merged without squashing
…#665) ## Description Updates the SDK to support the A2A Protocol v1.0.0-rc specifications. ## Changes - **Protocol Update**: Updated core types, definitions, `Client`, and `Server` implementations to match Protocol v1.0.0-rc. - **Bug Fixes**: - Fixed `RestTransport` URL construction. - Resolved `pyright`, `ruff`, and `mypy` linting errors across the codebase. - Fixed import resolution issues for optional dependencies (`grpc`, `sqlalchemy`, `opentelemetry`). - **Tests**: - Fixed all failing unit and integration tests. - Added support for running PostgreSQL and MySQL integration tests (verified locally). - **Cleanup**: Removed redundant `pyrightconfig.json`. ## Testing - All unit and integration tests are passing. - Database integration tests verified locally with Docker containers (docker-compose file was used for verification but is not included in the repo). Re a2aproject#559 --------- Signed-off-by: Luca Muscariello <muscariello@ieee.org>
To resolve existing merge issues first.
Fixes a2aproject#697 (comment), bad merge in a2aproject#696. Cover "list tasks" in client-server integration tests which would prevent it. Re a2aproject#559.
Bring back `.pre-commit-config.yaml` and disabled JSCPD linter. Removal can be evaluated separately, for now bringing them back to make diff against `main` more focused. Re a2aproject#559.
Tests basic functionality with real client and server with real handlers, only agent executor is provided in test as it'd be in a real usage. Re a2aproject#559
JSON-RPC diverged a bit, update it to match other transports. Domain request handler returns `Task | Message` from `on_message_send` already. Fixes a2aproject#697 (comment). Re a2aproject#559.
According to [the spec](https://a2a-protocol.org/latest/specification/#314-list-tasks) all response fields are mandatory. Update implementation and add tests to cover. Re a2aproject#515
Active updates are happening to [A2A repo](https://github.com/a2aproject/A2A/commits/main/) currently. Switch `buf.gen.yaml` back to `main` (a2aproject#699 switched it to the 1.0 RC tag to progress with merge without regenerating files) and update code to work with the latest changes. Re a2aproject#559.
Following > The operation MUST return a Task object as the first event in the stream introduced in 1.0: https://a2a-protocol.org/latest/specification/#316-subscribe-to-task It also correctly uses `UnsupportedOperationError` as per the "Errors" section from the documentation linked above. Fixes a2aproject#675 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
According to https://a2a-protocol.org/latest/specification/#324-history-length-semantics. It changes behavior so the fix was postponed till 1.0. After changing to proto passing `.history_length` would not work anymore due to the way how proto generated code works - optional values are still translated to language defaults to avoid `None`s, while presence should be checked via `HasField` - done in this PR. Fixes a2aproject#573 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
# Description See [here](https://a2a-protocol.org/latest/specification/#validation-error-example) and [3.1.4. List Tasks](https://a2a-protocol.org/latest/specification/#314-list-tasks). Re a2aproject#515
## Description As per the 1.0 spec update (see [4.3.3. Push Notification Payload](https://a2a-protocol.org/latest/specification/#433-push-notification-payload)) use `StreamResponse` as push notifications payload. Fixes a2aproject#678 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Use enum everywhere, data model uses `str` for protocol names, so custom protocols won't be constrained with the enum. Fixes a2aproject#705
…2aproject#813) Removed redundant type casting in database_task_store.py.
1. Run release-please on 1.0-dev and set `target-branch` in the GitHub Action. 2. Use advanced configuration to specify pre-release versioning (`"prerelease": true` and `"prerelease-type": "alpha"`), this is going to result in `1.0.0a0` (see [here](https://packaging.python.org/en/latest/specifications/version-specifiers/#pre-releases) package for `v1.0.0-alpha.0` tag. 3. [python-publish.yml](https://github.com/a2aproject/a2a-python/blob/main/.github/workflows/python-publish.yml) workflow was disabled as a safety measure in case release-please goes crazy with this config. For now do not specify `last-release-sha` explicitly ([docs](https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md#configfile)), will check the behavior first, changelog will have to be created manually most likely either way.
Release-As: v1.0.0-alpha.0
From ```bash git log origin/main..1.0-dev --oneline --reverse | head -n 1 ```
…aproject#812) # Description Old version is not able to write in databases which are `1.0` compatible because the new `owner` field is mandatory. This change makes the `owner` field `optional` to maintain forward compatibility. ## Tested ### Before change (owner field mandatory) I created a database with tables `tasks` and `push_notification_configs` using `1.0` spec. I then tested it against `0.3` spec by trying to **write** in it. It failed returning an error: `NOT NULL constraint failed: tasks.owner`. Also, I created a database with `0.3` spec `Task` and `PushNotificationConfigs` entries but then made it `1.0` compatible via migration CLI command `uv run a2a-db`. **Reading** such data using `0.3` spec worked, but **writing** failed for the same reason as before. ### After change (owner field optional) I repeated the testing from before. Now writing in `1.0` compatible databases worked. ## Notes Writing in database which was created using `1.0` spec without running the migration `a2a-db` CLI command, created entries which have `owner=NULL` values, contrary to databases that underwent the migration using `a2a-db` which have `owner` field populated with the default value. In my case with `legacy_v03_no_user_info` since I didn't use the `--add_columns_owner_last_updated-default-owner` flag to pass my own custom default value. ## Contributing Guide - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [x] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [x] Appropriate docs were updated (if necessary) Fixes a2aproject#811 🦕
……s`, `artifacts`, and `history`. (a2aproject#819) This is a rollback of a change made in: a2aproject#783
…a2aproject#814) # Description This PR addresses two main issues related to the list_tasks JSON-RPC endpoint: - Fixed how list_tasks formats the ListTasksResponse to ensure all fields are explicitly printed, even when they carry default values (such as an empty next_page_token). - Replaced generic ValueError exceptions with A2A SDK's standard InvalidParamsError when handling malformed or invalid pagination tokens. This correctly surfaces -32602 Invalid params via JSON-RPC.
…ts (a2aproject#820) - Removed the `/v0.3` prefix from v0.3 compatibility REST routes in `A2ARESTFastAPIApplication`, unifying the URL routing structure. - Expanded cross-version integration tests (`client_0_3`, `client_1_0`, `server_0_3`, `server_1_0`) to validate complex message parts, including URIs, raw bytes, and structured data parts. - Added cross-version test coverage for the push notification config lifecycle (create, get, list, delete) and task listing. - Improved subprocess cleanup and lifecycle management in `test_client_server.py` using process groups (`os.killpg`) to prevent dangling server processes on timeout. - Added a custom logging middleware for easier debugging during cross-version integration tests.
…#799) (a2aproject#800) Made a minor change to A2ACardResolver.get_agent_card() so it doesn't introduce an spurious trailing slash when agent_card_path is empty. This allows one to get the card from a card URL without having to break it into a base and relative card path component, it's arguably a bit odd but the empty agent_card_path is technically allowed and the result of that isn't right so I think it's a reasonable improvement, and one that as far as I can see can't reasonably be not backwards compatible for anyone. I changed one existing test, but only in a fashion such that it still tests the thing that it says it is testing... It is fine IF I understood the point of the test... # Description Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [X] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [X] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [X] Appropriate docs were updated (if necessary) Fixes a2aproject#799 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com>
…#790) # Description This PR implements standard gRPC rich error handling using `google.rpc.Status` and `google.rpc.ErrorInfo`, bringing the SDK's gRPC transport fully in line with the A2A v1.0 specification. Previously, the gRPC server appended the exception name to the string message (e.g., "TaskNotFoundError: task not found"), and the client relied on string splitting to parse the error back into a domain exception. This approach was brittle and not interoperable with standard gRPC ecosystems (proxies, gateways, etc.). This PR replaces the legacy string-parsing heuristic entirely with strongly-typed binary metadata (`grpc-status-details-bin`). - [X] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [X] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [X] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [X] Appropriate docs were updated (if necessary) Fixes a2aproject#723 🦕 --------- Co-authored-by: Ivan Shymko <ishymko@google.com>
…a2aproject#821) # Description Fix the database PushNotificationConfig store when reading legacy data from version 0.3. The store now correctly handles cases when legacy PushNotificationConfig was stored.
It's not fully transparent for non-release versions (like alpha or rc) how git tag names (i.e. `v1.0.0-alpha.0`) are converted to [Python version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers) (i.e. `1.0.0a0`). This can be checked only during [publish GitHub action](https://github.com/a2aproject/a2a-python/actions/workflows/python-publish.yml) execution which both builds and pushes PyPi package. `release-please` supports updating `pyproject.toml` so we will have the same level of automation. Current version is set to `0.3.25` - the latest release from `main`.
…2aproject#827) Turns out it creates more problems than solves and requires more intervention into release-please to also update `uv.lock`. release-please still uses SemVer values in its PRs, but they are normalized during build (see [here](https://packaging.python.org/en/latest/specifications/version-specifiers/#normalization)).
1. Aligned with https://a2a-protocol.org/latest/specification/#54-error-code-mappings. 2. Added roundtrip tests to `test_client_server_integration.py`. 3. Renamed `AuthenticatedExtendedCardNotConfiguredError` -> `ExtendedAgentCardNotConfiguredError`.
…lient_interceptors' into guglielmoc/rework_client_interceptors
…k_client_interceptors
…ript for generation and `gh` CLI for PRs, and remove direct `buf` installation from unit tests.
…ated script and commit generated files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit: a2aproject/A2A@test